import constVal from '../../unit/const.js';

let {
	maxPoint
} = constVal;


let initState = 0;

if (initState < 0) {
	initState = 0;
} else if (initState > maxPoint) {
	initState = maxPoint;
}

export default {
	state: initState,
	points(state, payload) {
		state.points = payload > maxPoint ? maxPoint : payload; // 最大分数
	}
};